-
Notifications
You must be signed in to change notification settings - Fork 8
test: Add update test helpers #1162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously there was no way to test transitions that would be enforced via CEL. This commit fixes that and allows the testing of CEL transition rules on update, which will be necessary for some future handlers.
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds testing helpers to validate update transitions enforced via CEL. Key changes include:
- Introducing CEL validation in update flows by adding ValidateClusterVariableUpdate and a new validateCEL function.
- Enhancing JSON schema conversion to support custom validations through XValidations.
- Updating the test definitions to distinguish between initial and update validation through the introduction of an OldVals field.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| common/pkg/testutils/openapi/validate.go | Adds CEL-based validation logic and update helper functions for cluster variables. |
| common/pkg/testutils/openapi/convert.go | Updates schema conversion to support XValidations integration. |
| common/pkg/testutils/capitest/variables.go | Adjusts test definitions to support update validation using the new OldVals field. |
| common/go.mod | Updates module requirements by adding and removing redundant k8s.io/apiserver dependency. |
Comments suppressed due to low confidence (1)
common/pkg/testutils/capitest/variables.go:25
- [nitpick] Consider renaming 'OldVals' to 'OldValues' for improved clarity and consistency with the 'Vals' field.
OldVals any
Contributor
Automated PR Comment From Black Duck SCA❌ Found dependencies violating policy!
|
dkoshkin
approved these changes
Jun 16, 2025
thunderboltsid
approved these changes
Jun 17, 2025
Merged
supershal
added a commit
that referenced
this pull request
Jun 24, 2025
🤖 I have created a release *beep* *boop* --- ## 0.30.0 (2025-06-24) <!-- Release notes generated using configuration in .github/release.yaml at main --> ## What's Changed ### Exciting New Features 🎉 * feat: Build with Go 1.24.4 to fix CVEs by @jimmidyson in #1157 * feat: add requests and limits to registry containers by @dkoshkin in #1158 * feat: Add preflight checks framework by @dlipovetsky in #1129 * feat: Preflight check opt-out by @dlipovetsky in #1156 * feat: Nutanix VM image preflight check by @dlipovetsky in #1130 * feat: update addons by @dkoshkin in #1168 * feat: Enforce MD replicas within cluster autoscaler bounds by @jimmidyson in #1169 * feat(preflight): Storage container checks for Nutanix by @thunderboltsid in #1136 * feat: update Nutanix CSI to 3.3.4 by @dkoshkin in #1179 ### Fixes 🔧 * fix: update CNCF registry version to 2.3.4, app version 2.8.3 by @dkoshkin in #1150 * fix: registry addon headless service port by @dkoshkin in #1159 * fix: preserve registry addon root CA on move by @dkoshkin in #1155 * fix: Add noderegistration patch to previous handler by @jimmidyson in #1177 ### Other Changes * build: include regclient/regsync image for registry addon by @dkoshkin in #1148 * test: Add update test helpers by @jimmidyson in #1162 * test(e2e): Nutanix 1.33.1 testing by @jimmidyson in #1164 * build: Update all tools by @jimmidyson in #1165 * refactor: add global feature.Gates variable by @dkoshkin in #1167 * ci: new env variable to set --feature-gates by @dkoshkin in #1166 * build: github.com/hashicorp/[email protected] to fix CVE by @jimmidyson in #1170 * docs: Update link to default Cilium values in cni.md by @yannickstruyf3 in #1173 * docs: Fix up Cilium config link (again) & icons by @jimmidyson in #1176 ## New Contributors * @yannickstruyf3 made their first contribution in #1173 **Full Changelog**: v0.29.0...v0.30.0 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Shalin Patel <[email protected]>
jimmidyson
added a commit
that referenced
this pull request
Jun 25, 2025
This commit allows users to configure kube-proxy mode when creating clusters. This is enforced via CEL to prevent users from moving between kube-proxy and non-kube-proxy deployments. Supports `iptables` (default), and `nftables` modes. Skipping `kube-proxy` deployment and management by CAPI is enabled via setting the upstream `controlplane.cluster.x-k8s.io/skip-kube-proxy` annotation on the `Cluster` `spec.topology.controlPlane.metadata.annotation`. This will configure `kubeadm` to skip the `addon/kube-proxy` phase. Follow up work will allow Cilium configuration to enable their kube-proxy replacement (already possible via custom Helm values) and migration from kube-proxy to kube-proxy replacement for existing clusters. Requires #1162.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously there was no way to test transitions that would be
enforced via CEL. This commit fixes that and allows the testing
of CEL transition rules on update, which will be necessary for
some future handlers.